package com.pf.java;


/**
 * @author pf
 * @date 2021/10/21-15:38
 */
public class StringTest {

    public static void main(String[] args) {
        System.out.println("hello world");

        StringBuilder stringBuilder = new StringBuilder();
        System.out.println(stringBuilder.capacity());//查看字符串长度

        stringBuilder.append("hello").append(" world1").append("!!!!");
        System.out.println(stringBuilder.toString());
        System.out.println(stringBuilder.capacity());

        stringBuilder.insert(4,"123");
        System.out.println(stringBuilder.toString());
        System.out.println(stringBuilder.capacity());

        stringBuilder.delete(0,6);//<6
        System.out.println(stringBuilder.toString());
        System.out.println(stringBuilder.capacity());




    }
}
